- page_title _("Milestones")
- add_page_specific_style 'page_bundles/milestone'

- if @milestone_states.any? { |name, count| count > 0 }
  .top-area
    = render 'shared/milestones_filter', counts: @milestone_states

    .nav-controls
      = render 'shared/milestones/search_form'
      = render 'shared/milestones_sort_dropdown'
      - if can?(current_user, :admin_milestone, @group)
        = render Pajamas::ButtonComponent.new(href: new_group_milestone_path(@group), variant: :confirm, button_options: { data: { qa_selector: "new_group_milestone_link" }, class: "gl-ml-3" }) do
          = _('New milestone')
  - if @milestones.blank?
    = render 'shared/empty_states/milestones_tab', learn_more_path: help_page_path('user/project/milestones/index') do
      - if can?(current_user, :admin_milestone, @group)
        .text-center
          = render Pajamas::ButtonComponent.new(href: new_group_milestone_path(@group), variant: :confirm, button_options: { data: { qa_selector: "new_group_milestone_link" }}) do
            = _('New milestone')
  - else
    .milestones
      %ul.content-list
        - @milestones.each do |milestone|
          - if milestone.project_milestone?
            = render 'projects/milestones/milestone', milestone: milestone
          - else
            = render 'milestone', milestone: milestone
      = paginate @milestones, theme: "gitlab"
- else
  = render 'shared/empty_states/milestones', learn_more_path: help_page_path('user/project/milestones/index') do
    - if can?(current_user, :admin_milestone, @group)
      .text-center
        = render Pajamas::ButtonComponent.new(href: new_group_milestone_path(@group), variant: :confirm, button_options: { data: { qa_selector: "new_group_milestone_link" }}) do
          = _('New milestone')
